<!DOCTYPE html>
<html lang="en">
<head>
	<{include file="header.html"}>
	<title>题库管理-<{$user_data['school_name']}>-德安信会计在线教育平台</title>
</head>
<body>
<div class="wrap">
	<!--star left-->
	<div class="column">
		<{include file="left_menu.html"}>
	</div>
	<div id="ContMianBox">
		<!--star子栏目-->
            <{include file="left_menu_min.html"}>
        <!--end子栏目-->
		<!--end left-->
		<div class="container narrow">
		    <!--star conter-->
		    <div class="cetContent">
				<div class="tit p-lr20">
				    <span><a href="/school">导航设置</a></span>
                    <!-- <span><a href="/school/info">基本资料</a></span> -->
                    <span><a href="/school/modulars">首页模块设置</a></span>
                    <span class="curr"><a href="/advertising">网校Banner</a></span>
                    <span><a href="/school_page">网校页面</a></span>
                    <span><a href="/school/wx_pay_config">微信支付设置</a></span>
				</div>
				<!--star内容区域-->
				<div class="mainScroll">
				    <div class="mainContainer line-all">
				        <!--star tabMainCont-->
				        <div class="tabMainCont">
			                <form class="layui-form layui-form-pane" method="post" enctype="multipart/form-data" action="/advertising/save">
								<input type="hidden" name="id" value="<{$info['id']|default:"0"}>" />

								<div class="layui-form-item">
									<label class="layui-form-label">广告标题</label>
									<div class="layui-input-block">
										<input type="text" id="ad_name" name="ad_name" value="<{$info.ad_name|default:''}>" lay-verify="title" autocomplete="off" class="layui-input">
									</div>
								</div>

								<div class="layui-form-item">
									<label class="layui-form-label">广告位</label>
									<div class="layui-input-block">
										<select name="ad_position_sign" id="cid" class='ad' id="ad" datatype="*">
											<option value="" >请选择广告位</option>
											<{foreach from=$cate_list item=item}>
												<option value="<{$item.sign}>" <{if isset($info.ad_position_sign) && $item.sign==$info.ad_position_sign}>selected=selected<{/if}>><{$item.ad_position_name}></option>
											<{/foreach}>
										</select>
									</div>
								</div>

								<div class="layui-form-item" style="display: none;">
									<label class="layui-form-label">广告类型</label>
									<div class="layui-input-block">
										<select id="ad_type" name="ad_type" class='ad' id="ad_type" datatype="*" lay-filter="ad_type">
											<option <{if $info.ad_type|default:1 == 1}> selected=selected <{/if}> value="1">页面广告</option>
											<option <{if $info.ad_type|default:1 == 2}> selected=selected <{/if}> value="2">用户</option>
											<option <{if $info.ad_type|default:1 == 3}> selected=selected <{/if}> value="3">视频</option>
											<option <{if $info.ad_type|default:1 == 4}> selected=selected <{/if}> value="4">直播</option>
										</select>
									</div>
								</div>

								<div class="layui-form-item ad_type ad_type_1" ad_type="1" id="h5" <{if $info.ad_type|default:1 != 1}>style="display:none;"<{/if}>>
									<label class="layui-form-label">广告链接</label>
									<div class="layui-input-block">
										<input type="text" id="ad_url" name="ad_url" value="<{$info.ad_url|default:''}>" lay-verify="title" autocomplete="off" class="layui-input">
									</div>
								</div>

								<{if $info.ad_type == 2 || !$info}>
								<div class="layui-form-item ad_type ad_type_2" ad_type="2" id="user" <{if $info.ad_type|default:1 != 2}>style="display:none;"<{/if}>>
									<label class="layui-form-label">绑定用户</label>
									<div class="layui-input-block ysx_video">
										<input id="ad_user_vuid" class="vuid" type="hidden" value="<{$info['top_id']|default:'0'}>" name="uid">
										<input id="ad_user_vuid_title" class="layui-input vuid_title" type="text" value="<{$info.nick|default:''}>" readonly="true">	
									</div>
									<div class="Validform_checktip oi_ab ab_380px"></div>
								</div>
								<{/if}>

								<div class="layui-form-item ad_type ad_type_3" ad_type="3" id="video" <{if $info.ad_type|default:1 != 3}>style="display:none;"<{/if}>>
									<label class="layui-form-label">绑定活动视频</label>
									<div class="layui-input-block">
										<input type="hidden" id="temp_grade_video_id" value="<{$info['top_id']|default:''}>"/>
										<input type='text' class="layui-input" readonly id="grade_video_id" value="<{$info['top_id']|default:''}>" name='vid' onclick="javascript:videoshow();"/>
									</div>
								</div>

								<{if $info.ad_type == 4 || !$info}>
								<div class="layui-form-item ad_type ad_type_4" ad_type="4" id="live" <{if $info.ad_type|default:1 != 4}>style="display:none;"<{/if}>>
									<label class="layui-form-label">绑定直播用户</label>
									<div class="layui-input-block">
										<input id="live_user_vuid" class="vuid" type="hidden" value="<{$info['top_id']|default:'0'}>" name="anchor_id">
										<input id="live_user_vuid_title" class="layui-input live_vuid_title" type="text" value="<{$info.nick|default:''}>" readonly="true">
									</div>
								</div>
								<{/if}>

								<div class="layui-form-item layui-form-text">
									<input type="hidden" id="token" value="<{'VIMG'|get_qiniu_token}>" />
									<label class="layui-form-label">封面图</label>
									<div class="layui-input-block" style="margin-top: 5px;">
							            <div id="uploader2" class="upload_box" style="float:left; width:420px;">
							                <div class="queueList">
							                    <div id="dndArea2" class="placeholder dndArea">
							                        <div id="filePicker2" class="filePicker"></div>
							                        <p>或将照片拖到这里，最多可上传<script>document.write(fileNumLimit);</script>张图片</p>
							                    </div>
							                </div>
							                <div class="statusBar" style="display:none;">
							                    <div class="progress">
							                        <span class="text">0%</span>
							                        <span class="percentage"></span>
							                    </div><div class="info"></div>
							                    <div class="btns">
							                        <div id="filePickerBut2" class="filePickerBut"></div><div class="uploadBtn">开始上传</div>
							                    </div>
							                </div>
							                <div class="upload_img_input" input_name='ad_image_url'></div>
							            </div>
							            <{if isset($info['ad_image_url']) AND $info['ad_image_url'] != ''}>
								  			<div class="layui-inline" style="float:left;"><img src="<{$info['ad_image_url']}>" style="max-height:175px;"/></div>
								  		<{/if}>
									</div>
								</div>

								<div class="layui-form-item">
									<label class="layui-form-label">排序</label>
									<div class="layui-input-block">
										<input type="text" onafterpaste="this.value=this.value.replace(/\D/g,'')" onkeyup="this.value=this.value.replace(/\D/g,'')" name="sort" value="<{$info.sort|default:'0'}>" lay-verify="title" autocomplete="off" class="layui-input">
									</div>
								</div>

								<div class="layui-form-item">
							    	<label class="layui-form-label">是否启用</label>
							        <div class="layui-input-block">
							        	<{assign var="status" value=$info['status']|default:"1"}>
							  			<input type="checkbox" <{if $status == 1}> checked<{/if}> name="status" lay-skin="switch" lay-filter="switchTest" value="1" >
							        </div>
							  	</div>
								<div class="layui-input-block">
									<button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
									<button type="reset" class="layui-btn layui-btn-primary">重置</button>
								</div>

							</form>

			                <div class="pages p-tb20" style="text-align:right;">
			                    <{$pagination}>
			                </div>

			            </div>
			            <!--star会员管理-->
			        </div>
				        <!--end tabMainCont-->
		        </div>

		    </div>
		</div>

	</div>
	<{include file="footer.html"}>
	<script>
		$(function(){
			$(".sub-colum").find('li').on('click',function(){//子栏目点击选中状态；
				$(this).addClass('curr').siblings().removeClass('curr');
			})

		});
	</script>
</div>
<script type="text/javascript">

	//绑定用户
	$(document).on('click', '.vuid_title', function(){
		var input_id = 'ad_user';
		art.dialog({id:'video_select',iframe:'user/index/0/0/0/'+input_id, title:'选择用户', width:'1500', height:'700', lock:true});
	});
	//绑定用户
	$(document).on('click', '.live_vuid_title', function(){
		var input_id = 'live_user';
		art.dialog({id:'video_select',iframe:'user/index/0/0/0/'+input_id, title:'选择用户', width:'1500', height:'700', lock:true});
	});

	function videoshow() {
		$.layer({
			type: 2,
			title: [
				'绑定活动视频', 
				'background:#2B2E37; height:40px; color:#fff; border:none;' //自定义标题样式
			], 
			border:[0],
			area: ['90%', '90%'],
			iframe: {src: '/video/index/0/0/0/0/0/0/0'}
		})
	}

	layui.use(['form','jquery'], function(){
		var form = layui.form(),$ = layui.jquery;

		form.on('select(ad_type)', function(data){
			var type = $(data.elem).val();
			$(".ad_type").hide();
			$(".ad_type_"+type).show();
			
		});
		
	});
</script>
</body>
</html>